import java.io.File;

/**
 * Created with IntelliJ IDEA.
 * Description:文件删除
 * Author: WJW
 * Date: 2024-08-20
 * Time: 11:34
 */
public class IODemo3 {
    public static void main(String[] args) throws InterruptedException {
        File file = new File("./test.txt");
        //boolean ret = file.delete();//立即删除
        //System.out.println(ret);

        file.deleteOnExit();//程序运行结束退出时删除
        Thread.sleep(5000);
    }
}
